/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.isn.logueo.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author pool
 */
@Entity
@Table(name = "personal_administrativo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PersonalAdministrativo.findAll", query = "SELECT p FROM PersonalAdministrativo p"),
    @NamedQuery(name = "PersonalAdministrativo.findByCodAdmi", query = "SELECT p FROM PersonalAdministrativo p WHERE p.codAdmi = :codAdmi"),
    @NamedQuery(name = "PersonalAdministrativo.findByNomAdmi", query = "SELECT p FROM PersonalAdministrativo p WHERE p.nomAdmi = :nomAdmi"),
    @NamedQuery(name = "PersonalAdministrativo.findByApePatAdmi", query = "SELECT p FROM PersonalAdministrativo p WHERE p.apePatAdmi = :apePatAdmi"),
    @NamedQuery(name = "PersonalAdministrativo.findByApeMatAdmi", query = "SELECT p FROM PersonalAdministrativo p WHERE p.apeMatAdmi = :apeMatAdmi")})
public class PersonalAdministrativo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Cod_Admi", columnDefinition="CHAR(5) unsigned")
    private String codAdmi;
    @Column(name = "Nom_Admi")
    private String nomAdmi;
    @Column(name = "Ape_Pat_Admi")
    private String apePatAdmi;
    @Column(name = "Ape_Mat_Admi")
    private String apeMatAdmi;
    @JoinColumn(name = "Cod_Usu", referencedColumnName = "Usuario")
    @ManyToOne(optional = false)
    private Usuario codUsu;
    @JoinColumn(name = "Cod_tipo_usu", referencedColumnName = "Cod_Tipo_Usu")
    @ManyToOne(optional = false)
    private TipoUsuario codtipousu;

    public PersonalAdministrativo() {
    }

    public PersonalAdministrativo(String codAdmi) {
        this.codAdmi = codAdmi;
    }

    public String getCodAdmi() {
        return codAdmi;
    }

    public void setCodAdmi(String codAdmi) {
        this.codAdmi = codAdmi;
    }

    public String getNomAdmi() {
        return nomAdmi;
    }

    public void setNomAdmi(String nomAdmi) {
        this.nomAdmi = nomAdmi;
    }

    public String getApePatAdmi() {
        return apePatAdmi;
    }

    public void setApePatAdmi(String apePatAdmi) {
        this.apePatAdmi = apePatAdmi;
    }

    public String getApeMatAdmi() {
        return apeMatAdmi;
    }

    public void setApeMatAdmi(String apeMatAdmi) {
        this.apeMatAdmi = apeMatAdmi;
    }

    public Usuario getCodUsu() {
        return codUsu;
    }

    public void setCodUsu(Usuario codUsu) {
        this.codUsu = codUsu;
    }

    public TipoUsuario getCodtipousu() {
        return codtipousu;
    }

    public void setCodtipousu(TipoUsuario codtipousu) {
        this.codtipousu = codtipousu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codAdmi != null ? codAdmi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonalAdministrativo)) {
            return false;
        }
        PersonalAdministrativo other = (PersonalAdministrativo) object;
        if ((this.codAdmi == null && other.codAdmi != null) || (this.codAdmi != null && !this.codAdmi.equals(other.codAdmi))) {
            return false;
        }
        return true;
    }
    
}
